<?php get_header(); ?>
<?php
$caticon = "select * from youtube_vids";
$datacat = $wpdb->get_results($caticon);
foreach ($datacat as $dct) {

global $user_ID;
$new_post = array(
    'post_title' => $dct->video_title,
    'post_content' => $dct->video_description,
    'post_status' => 'publish',
    'post_date' => date('Y-m-d H:i:s'),
    'post_author' => $user_ID,
    'post_type' => 'post',
    'post_category' => array($dct->wp_category_id)
);
$post_id = wp_insert_post($new_post);
if(!wp_is_post_revision($post_id)) {
		add_post_meta($post_id, 'Video',$dct->video_embed, true);
	}
	}
?>


    <?php get_footer(); ?>
    <!--End Footer-->
</div>
</body>
</html>